-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Website Forms #8
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a dedicated module/namespace for handling forms. Forms, as described in this guide can be created through the dashboard, then Hellotext.js would be responsible for creating, authenticating and validating the values users submit.
Reorganization
This PR performer a major overhaul over the structure of the library. Almost all top-level files have been moved into a dedicated folder, such as
core
,models
,controllers
,builders
.Global Config object
This PR introduced a global config class that's accessible by every other class in the package. This is useful for holding package-wide information in a single register. For example, it holds the API root url,
hellotext.js/src/core/configuration.js
Line 2 in cf0e164
And dedicated API files use that root to generate an endpoint,
hellotext.js/src/api/businesses.js
Lines 4 to 17 in cf0e164
APIs
This PR expands over the set of APIs the package interacts with, and thus a dedicated folder
api
has been introduced to hold endpoints for the various objects this package uses. See the available ones in https://github.com/hellotext/hellotext.js/tree/forms/src/api.Forms
This PR adds a new module, namely
Forms
which is exposed underHellotext.forms
, which returns an instance ofFormCollection
. Hellotext.js, once initialized attached aload
event listener to the window, once loaded it looks for elements in the document viadata-hello-form
identifier and fetches their public information viapublic/forms
endpoint.Collected forms can be mounted manually to keep the developer in control, a form can be mounted by calling the
mount
method on the object, such asEvents
Underneath, this PR overhauls the event management code, on the outside, this PR introduces 2 new events, namely
forms:collected
andform:completed
.In addition, we've introduced prettier to style the codebase.